<template>
  <el-container>
    <el-main>
      <el-descriptions title="独柱墩详情" direction="horizontal" :column="2" border>
        <el-descriptions-item label="结点id">{{content.roadNodesId}}</el-descriptions-item>
        <el-descriptions-item label="结点名称">{{content.nodeName}}</el-descriptions-item>
        <el-descriptions-item label="所属路段id">{{content.roadSegsId}}</el-descriptions-item>
        <el-descriptions-item label="所属高速公路" :span="2">{{content.highRoads.highRoadName}}</el-descriptions-item>
        <el-descriptions-item label="经度">{{content.longitude}}</el-descriptions-item>
        <el-descriptions-item label="纬度" :span="2">{{content.latitude}}</el-descriptions-item>
        <el-descriptions-item label="途径州市" :span="2">{{content.indexCities}}</el-descriptions-item>
        <el-descriptions-item label="备注" :span="2">{{content.nodeComment}}</el-descriptions-item>
      </el-descriptions>
    </el-main>
  </el-container>

</template>

<script>
import axios from "axios";
import {ElMessage} from "element-plus";

export default {
  name: "roadStonesChild",
  props:{
    roadNodesId: Number
  },
  data(){
    return{
      content:{
        roadNodesId:"",
        roadSegsId:"",
        highRoadsId:"",
        nodeName:"",
        longitude:"",
        latitude:"",
        indexCities:"",
        nodeComment:"",
        roadSegs:{},
        highRoads:{}
      }
    }
  },
  mounted() {
    axios({
      method: 'post',
      url: '/api/road/selectRoadStone',
      params:{
        id:this.roadNodesId
      }
    })
        .then((res)=>{

          if(res.data.code==="1"){//返回成功
            this.content=res.data.data.roadStone
          }else{//返回失败
            // alert("查询失败")
            ElMessage.error('查询失败')
            this.$emit('wrong')
          }
        });
  }
}
</script>

<style scoped>
.el-container{
  height: 550px!important;
  width: 100%;
}
</style>